package com.unicom.si.controller;

import com.unicom.si.pojo.Dept;
import com.unicom.si.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DeptController {

    @Autowired
    private DeptService deptServ;

    @RequestMapping("/dept/{deptid}")
    public @ResponseBody Dept getDept(@PathVariable("deptid") int deptid) {

        return deptServ.queryDeptService(deptid);
    }

    @RequestMapping("/dept/id/{deptid}")
    public @ResponseBody Dept getDeptById(@PathVariable("deptid") int deptid) {

        return deptServ.checkDeptId(deptid);
    }

}
